<# # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script is designed To check the service state and then start the service # Configuration Type - COMPUTER # Arguments: Hardcode the values inside the script. #> # Change the service name value in the below area $serviceName = "Zoho Assist-Remote Support" try { $status = (Get-Service -Name $serviceName -ErrorAction Stop).Status if ($status -ne "Running") { Start-Service -Name $serviceName -ErrorAction Stop Write-Host "Service was not running. Attempted to start it." } else { Write-Host "Service is already running." } } catch { Write-Host "An error occurred: $_" }